import { fromJS } from "immutable";
import { constants } from ".";

const initialState = fromJS({
  isLogin: false
});

const reducer = (state = initialState, action) => {
  const { type, payload } = action;
  switch (type) {    
    case constants.CHANGE_LOGIN_SUCCESS:
      return state.set('isLogin', payload);
      case constants.LOGOUT:
        return state.set('isLogin', payload);
    default:
      return state;
  }
}

export default reducer;